package cn.zcib.film.service.impl;

import cn.zcib.film.anno.Record;
import cn.zcib.film.bean.User;
import cn.zcib.film.bean.vo.UserVO;
import cn.zcib.film.mapper.UserMapper;
import cn.zcib.film.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findUsers(UserVO userVO) {
        return userMapper.getUsers(userVO);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUserById(user);
    }

    @Override
    public int resetPassword(Integer uId) {
        return userMapper.resetPasswordById(uId);
    }

    @Override
    public int deleteUser(Integer uId) {
        return userMapper.deleteUserById(uId);
    }

    @Override
    public int countUsers() {
        return userMapper.countUsers();
    }

    @Override
    public List<Map<String, Integer>> userGenderPer() {
        return userMapper.userGenderPer();
    }
}
